package org.vnl.platform.job;

import java.util.Map;

/**
 * 定義了一個Job的行為,每個Job被執行前應先把其設定參數先設定完成
 * 
 * @author Vaughan
 *
 */
public interface IJob {
    
    int RESULT_SUCCESS = 0;
    int RESULT_FAIL = 1;
    
    /**
     * 設定Job的執行參數
     * @param params
     */
    void setParams(Map<String, ? extends Object> params);
    
    /**
     * 執行Job
     * @return
     * @throws JobExecException
     */
    int exec() throws JobExecException;

    /**
     * ResetJob
     * @throws JobExecException
     */
    void reset() throws JobExecException;
    
}
